<!DOCTYPE html>
<html>


	<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">


		<title>历史任务查看</title>
		<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
		<meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

		<link rel="shortcut icon" href="favicon.ico">
		<link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
		<link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

		<!-- Data Tables -->
		<link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

		<link href="css/animate.min.css" rel="stylesheet">
		<link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">

		<style>
			.col-sm-2{
				width:12.666667%
			}
		</style>
	</head>

	<body class="gray-bg">
		<div class="wrapper wrapper-content animated fadeInRight">
			<div class="row">
				<div class="col-sm-12">
					<div class="ibox float-e-margins">
						<div class="ibox-title">
							<h5>历史任务管理 <small>查看，查找</small></h5>
							<div class="ibox-tools">
								<a class="collapse-link">
									<i class="fa fa-chevron-up"></i>
								</a>
								<a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">
									<i class="fa fa-wrench"></i>
								</a>
								<ul class="dropdown-menu dropdown-user">
									<li><a href="table_data_tables.html#">选项1</a>
									</li>
									<li><a href="table_data_tables.html#">选项2</a>
									</li>
								</ul>
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="ibox-content">
							<div class="row">
								<div class="col-sm-2">
									<div class="input-group">
										<select id="isLinkUp" class="input-sm form-control input-s-sm inline">
											<option value="">是否沟通任务</option>
											<option value="true">是</option>
											<option value="false">否</option>
										</select>
										<span class="input-group-btn"><button type="button" class="btn btn-sm btn-primary" onclick="MyHisTask.methods.tableRefresh()">
												搜索</button> </span>
									</div>
								</div>
							</div>

							<table class="table table-striped table-bordered table-hover dataTables-example">
								<thead>
									<tr>
										<th>ID</th>
										<th>流程定义ID</th>
										<th>任务定义KEY</th>
										<th>流程实例ID</th>
										<th>执行ID</th>
										<th>名称</th>
										<th>父任务ID</th>
										<th>描述</th>
										<th>owner</th>
										<th>assignee</th>
										<th>创建时间</th>
										<th>结束时间</th>
										<th>结束原因</th>
										<th>沟通任务</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							</table>

						</div>
					</div>
				</div>
			</div>
		</div>
		<script src="js/jquery.min.js?v=2.1.4"></script>
		<script src="js/bootstrap.min.js?v=3.3.6"></script>
		<script src="js/plugins/jeditable/jquery.jeditable.js"></script>
		<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
		<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
		<script src="js/content.min.js?v=1.0.0"></script>
		<script src="js/plugins/layui-v2.4.5/layui/layui.all.js"></script>
		<script src="js/common.js"></script>
		<script>
			var _table = "";
			$(document).ready(function() {
				_table = $('.dataTables-example').DataTable({
					responsive: true,
					serverSide: true,
					searching: false,
					bLengthChange: false,
					// paging: false,
					sort: false,
					ajax: {
						url: 'http://localhost:8080/task/his/list',
						dataSrc: 'data',
						type: "GET",
						data: function(d) {
							d.isLinkUp=$("#isLinkUp").val();
						}
					},
					language: {
						"sProcessing": "处理中...",
						"sLengthMenu": "显示 _MENU_ 项结果",
						"sZeroRecords": "没有匹配结果",
						"sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
						"sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
						"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
						"sInfoPostFix": "",
						"sSearch": "过滤:",
						"sUrl": "",
						"sEmptyTable": "表中数据为空",
						"sLoadingRecords": "载入中...",
						"sInfoThousands": ",",
						"oPaginate": {
							"sFirst": "首页",
							"sPrevious": "上页",
							"sNext": "下页",
							"sLast": "末页"
						},
						"oAria": {
							"sSortAscending": ": 以升序排列此列",
							"sSortDescending": ": 以降序排列此列"
						}
					},
					columns: [{
							"data": "id"
						},
						{
							"data": "processDefinitionId"
						},
						{
							"data": "taskDefinitionKey"
						},
						{
							"data": "processInstanceId"
						},
						{
							"data": "executionId"
						},
						{
							"data": "name"
						},
						{
							"data": "parentTaskId"
						},
						{
							"data": "description"
						},
						{
							"data": "owner"
						},
						{
							"data": "assignee"
						},
						{
							"data": "createTime"
						},
						{
							"data": "endTime"
						},
						{
							"data": "deleteReason"
						},
						{
							"data": "linkUp"
						},
					],
					columnDefs: [{
							// 所有的列不允许搜索
							"orderable": false,
							"targets": "_all"
						},
						{
							"targets": -4,
							"render": function(val, b, row, d) {
								return common.timestampToTime(val);
							}
						},
						{
							"targets": -3,
							"render": function(val, b, row, d) {
								if(val){
									return common.timestampToTime(val);
								}
								return "";
							}
						},
						{
							"targets": -1,
							"render": function(val, b, row, d) {
								if (row.taskDefinitionKey == 'link_up_task') {
									return '<span class="badge badge-primary">是</span>';
								}
								return '<span class="badge badge-warning">否</span>'
							}
						}
					],
				});
			});



			var MyHisTask = {
				data: {
					assigneeWithPushMsgs: []
				},
				methods: {
					tableRefresh: function() {
						_table.ajax.reload();
					},
					createProcessInstance: function(_this) {
						var processDefinitionId = $(_this).attr("processDefinitionId");
						var data = {
							id: processDefinitionId
						}
						common.server.get('http://localhost:8080/common/process/start', data);
					}
				}
			}
		</script>

	</body>
</html>
